package ebcs.scan.common.utils;

import jplat.core.session.redis.JRedisConnector;

/**
 * 单例获取redis链接
 */
public class JRedisClientUtil {

    private static volatile JRedisConnector connector;

    /**
     * 声明私有无参
     */
    private JRedisClientUtil(){

    }

    /**
     * 获取连接对象
     * @return
     */
    public static JRedisConnector getConnector(){
        if(connector == null){
            //同步机制，避免实例多个对象
            synchronized(JRedisClientUtil.class){
                if(connector == null){
                    connector = JRedisConnector.getInstance();
                }
            }

        }
        return connector;
    }
}
